{% extends 'base.html' %}
{% block main %}
<nav class="navbar navbar-default" role="navigation">
						<div class="navbar-header">
							 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#"><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;购物车</a>
						</div>


					</nav>

					<table class="table">
						<thead>
							<tr>
								<th>
									品名
								</th>
								<th>
									单价
								</th>
                                <th>
									数量
								</th>
							</tr>
						</thead>
                    {% if myuser %}
                            {% if food_car %}
						<tbody>
                        {% for foo in food_car %}
							<tr>
								<td>
									<img src="{{ foo.img }}" width="50">&emsp;{{ foo.food_name }}
								</td>
								<td>
									{{ foo.food_money }}元
								</td>
								<td>
                                    <a href="/order/car_jia_jian/?num=jian&food_id={{ foo.eat_food }}"><button type="button" class="btn btn-default btn-xs">-</button></a>
									&nbsp;{{ foo.food_num }}
                                    <a href="/order/car_jia_jian/?num=jia&food_id={{ foo.eat_food }}"><button type="button" class="btn btn-default btn-xs">+</button></a>
								</td>
							</tr>
                        {% endfor %}
						</tbody>
                        <thead>
							<tr>
								<th style="text-align: right;" colspan="4">
									合计:<b style="color: red;font-size: 25px;">{{ order_money }}</b>元
								</th>
                            </tr>
                            <tr>
                                <th style="text-align: right;" colspan="4">
                                    <a style="" href="/order/order_views/"><button type="button" class="btn btn-success btn-default"><span class="glyphicon glyphicon-send" style="font-size: 12px"></span>&nbsp;马上下单</button></a>&nbsp;
                                    <a href="/"><button type="button" class="btn btn-default"><span class="glyphicon glyphicon-share-alt" style="font-size: 12px"></span>&nbsp;返回继续点餐</button></a>
                                </th>
                            </tr>
                                {% else %}
                                <tr>
                                    <td colspan="3" align="center">购物车空空如也~</td>
                                </tr>
                                <tr>
                                <td  colspan="3">
                                    <a href="/"><button type="button" class="btn btn-default btn-block btn-success">选择美食即可下单~</button></a>
                                </td>
                                </tr>
                                {% endif %}
                    {% else %}
                        <tr>
                        <td></td>
                        <td align="center">购物车空空如也~</td>
                        <td></td>
                        <a href="/logreg/log/"><button type="button" class="btn btn-default btn-block btn-success">登录即可下单哟~</button></a>
                    {% endif %}
                            </tr>
						</thead>
					</table>

{% endblock main %}